<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ยินดีต้อนรับเข้าสู่ ระบบบริการสื่อมัลติมีเดียด้านการเกษตร</title>
<script src="Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
body {
	background-image: url();
	background-repeat: no-repeat;
	background-color: #000000;
	margin-left: 0px;
	margin-top: -20px;
	margin-right: 0px;
	margin-bottom: 0px;
	
}
</style>
<SCRIPT language='JavaScript'>
var message="ระบบบริการสื่อมัลติมีเดียด้านการเกษตร";// ข้อความที่ให้แสดงเมื่อคลิกขวา 
// Don't edit below!
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);return false;}}
if (document.layers) {
if (e.which == 3) {
alert(message);return false;
}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);
}document.onmousedown=click;
// -->
</SCRIPT>
<?php 
include "connectdb.php" ;
/// Include the class 
require_once('VideoPlayer.class.php');

$SQL_SELECT_VDO="SELECT * FROM ag_vdodetail WHERE vdo_id=$id ;";
mysql_select_db($dbname) or die("เลือกฐานข้อมูลไม่ได้");
$dbquery = mysql_db_query($dbname,$SQL_SELECT_VDO);
$result = mysql_fetch_array($dbquery);
$vdo_name = $result[vdo_name];
$vdo_id = $result[vdo_id];
//$vdo_url=base64_decode($result[vdo_url]);
$vdo_url=$result[vdo_url];
$votesum=$result[vdo_votesum]; 
$votecount=$result[vdo_votecount]; 

function URL($vdo){
include "connectdb.php" ;
	if ($_SERVER['HTTP_REFERER']!='http://'.$host.'/'.$domain.'/vdo_player.php') {
		$myurl = $vdo;
		//echo $_SERVER['HTTP_REFERER'].'<br />';
		//echo 'http://'.$host.'/'.$domain.'/vdo_player2.php';
	} 
	else {
		$myurl = "MMS://$host/$domain/".base64_decode($vdo);		//แสดง vdo ที่ถูกต้อง
	}
$myurl = "MMS://$host/$domain/".base64_decode($vdo);
//$url = "MMS://$host/$domain/".base64_decode($vdo);
return $myurl;
}

$url = URL($vdo_url);

function url_parse($vdo){
		include "connectdb.php";
		$myurl = $path.str_replace("/","\\",base64_decode($vdo));

return base64_encode($myurl);
}

$url = url_parse($vdo_url);

?>

</head>
<body onLoad="MM_preloadImages('img/img09_2.jpg')">

<table width="400" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3" align="left" background="">
    
<?php 

		$video_player = new VideoPlayer($url, '400', '400', 'true');
	
		if (!$video_player) {
				die ($video_player->getLastError());
		}

		if(!$player = $video_player->player()) {
				die ($video_player->getLastError());
		} else {
				echo $player;
		}
		
?>

</td>
  </tr>
</table>
</body>
</html>
